# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma-systemmonitor
pkgver=6.0.4
pkgrel=0
pkgdesc="An application for monitoring system resources"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="LicenseRef-KDE-Accepted-GPL AND LicenseRef-KDE-Accepted-LGPL AND CC0-1.0"
depends="
	kirigami
	ksystemstats
	"
makedepends="
	extra-cmake-modules
	kconfig-dev
	kdbusaddons-dev
	kdeclarative-dev
	kglobalaccel-dev
	ki18n-dev
	kio-dev
	kirigami-addons-dev
	kitemmodels-dev
	knewstuff-dev
	kservice-dev
	libksysguard-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	samurai
	"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma-systemmonitor.git"
source="https://download.kde.org/stable/plasma/$pkgver/plasma-systemmonitor-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# ksystemstatstest is broken
	ctest --test-dir build --output-on-failure -E "ksystemstatstest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1e8269412c6bc8ce32f48fbc9bb7a847884926fcdd8231ab468b1bdc1824733d05d48b69f7fcce1fea92694d4b0bb0caf1f6819eb287dc2b2c0f6fc0bbadc004  plasma-systemmonitor-6.0.4.tar.xz
"
